#!/usr/bin/env python
import os
import django

# 设置Django环境
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dnsadmin.settings')
django.setup()

from django.contrib.auth.models import User

# 显示现有用户
users = User.objects.all()
print('现有用户:')
for user in users:
    user_type = "管理员" if user.is_superuser else "普通用户"
    print(f'- {user.username} ({user_type}) - {user.email}')

if not users:
    print('暂无用户')
else:
    print(f'\n总计: {users.count()} 个用户')